<template>
  <DataList :cate="cate" :cols="cols" :name="name"/>
</template>
<script>
import DataList from "@/components/DataList";
import { getUser } from "@/utils/auth";
import { addJfsrmx5,deleteJfsrmx5,updateJfsrmx5,getJfsrmx5} from "@/api/学校总收入中其他情况.js";
export default {
  components: {
    DataList
  },
  data() {
    return {
      cate: "A5-1-5学校总收入中其他情况",
      name:'5.1.5 学校总收入中其他情况',
      cols: [
        { label: "财政拨款总额(万元)", prop: "CZBKZE" },
        { label: "政府购买服务到款额(万元)", prop: "ZFGMFWDKE" },
        { label: "技术服务到款额(万元)", prop: "JSFWDKE" },
      ]
    };
  },
  methods: {
  
    async fetchData() {
      var user = getUser();
      var datas = await getJfsrmx5(user.XXID,user.CJPC);
      return datas;
    },
    onadd(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
      
          console.log(JSON.stringify(temp));
          var model = await addJfsrmx5(temp);
          resolve(model);
      })
      
    },
    onupdate(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
          console.log(JSON.stringify(temp));
          var model = await updateJfsrmx5(temp);
          resolve(model);
      })
      //
    },
    ondelete(model) {
       var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
        
         await deleteJfsrmx5(temp);
          resolve();
      })
    }
  }
};
</script>
<style>
</style>